<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@include file="/commons/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<fmt:bundle basename="res">
<head>
    <meta charset="utf-8">
    <title><fmt:message key='zhyyglhtxt'/></title>

    <jsp:include page="/WEB-INF/commons/commons-header.jsp" flush="true"/>
    <style>
        html {background:#fff;}
    </style>

</head>

<body>
<div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">

    <form:form commandName="role" method="${_method }" class="layui-form">
        <input type="hidden" name="_method" value="${_method }"/>
        <form:hidden path="id"/>
        <div class="layui-form-item">
            <label class="layui-form-label"><fmt:message key='jsmc'/></label>
            <div class="layui-input-block">
                <form:input path="showName" class="layui-input" style="width: 300px;"/>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><fmt:message key='jslx'/></label>
            <div class="layui-input-block">
                <input type="radio" name="type" value="1" title="<fmt:message key='xtjs'/>" <c:if test="${role.type eq 1}">checked="checked"</c:if> />
                <input type="radio" name="type" value="2" title="<fmt:message key='ywjs'/>" <c:if test="${role.type eq 2}">checked="checked"</c:if>>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><fmt:message key='jsbs'/></label>
            <div class="layui-input-block">
                <form:input path="name" class="layui-input" placeholder="<fmt:message key='jsbs'/>" style="width: 300px;"/>
            </div>
        </div>


        <div class="layui-input-block">
            <div style="display: none"><input type="button" value="<fmt:message key='bc'/>" class="layui-btn" id="submit"></div>
        </div>

    </form:form>

</div>

<script>

    $(function () {


        $("#submit").click(function () {

            $("form").ajaxSubmit({
                success: function (result) {
                    if (result.status) {
                        var index = parent.layer.getFrameIndex(window.name);
                        parent.layer.close(index);
                        parent.$("#search").click();
                    } else {
                        alert(result.message);
                    }
                }
            });
        });
    });
</script>
</body>
</fmt:bundle>
</html>